package cn.achao.csr.api.factory;

import cn.achao.csr.api.AliLoginApi;
import cn.achao.csr.api.model.resp.AliLoginResp;
import cn.achao.csr.base.resp.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author: achao
 **/
@Slf4j
@Component
public class AliLoginFallbackFactory implements FallbackFactory<AliLoginApi> {

    @Override
    public AliLoginApi create(Throwable throwable) {
        return new AliLoginApi() {
            @Override
            public R<AliLoginResp> zfbLogin(String status, String source) {
                return R.fail("支付宝登录暂不可用，请稍后再试!");
            }
        };
    }
}
